<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
		<link rel="stylesheet" type="text/css" href="/admin/js-css/css/style.css" />
		<link rel="stylesheet" type="text/css" href="/admin/js-css/css/myCarousel.css" />
		<link rel="stylesheet" type="text/css" href="/admin/js-css/css/skin_/login.css" />
		<script type="text/javascript" src="/admin/js-css/js/jquery.js"></script>
		<script type="text/javascript" src="/admin/js-css/js/jquery.select.js"></script>

		<link rel="stylesheet" href="/admin/plugin/layui/dist/css/layui.css"
			tppabs="http://res.layui.com/layui/dist/css/layui.css" media="all">
		<script src="/admin/plugin/layui/dist/layui.js" charset="utf-8"></script>
		<script src="/admin/js-css/js/lunbot.js"></script>

		<script type="text/javascript" src="/admin/js-css/js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="/admin/js-css/js/mx1.0.js?v=1.3"></script>
		<script type="text/javascript" src="/admin/js-css/js/mx1.0.1.js"></script>

		<title>系统后台登录</title>
	</head>

	<body>
		<div id="container">
			<div id="logo"></div>
			<div id="bd">
				<div id="main">
					<div class="left">
						<div class="carousel">
							<!-- 图片背景 -->
							<div class="content">
								<ul>
									<li><a href=""><img src="../js-css/img/skin_/list1.jpg" alt="" /></a></li>
									<li><a href=""><img src="../js-css/img/skin_/list2.jpg" alt="" /></a></li>
									<li><a href=""><img src="../js-css/img/skin_/list3.jpg" alt="" /></a></li>
								</ul>
							</div>
							<!-- 指示器 -->
							<div class="dot">
								<ul>
									<li class="active"><a href=""></a></li>
									<li><a href=""></a></li>
									<li><a href=""></a></li>
								</ul>
								
							</div>
						</div>
					</div>
					<div class="login-box">
						<h1 class="loginDL">登录</h1>
						<div class="loginIpt">
							<div class="input-box">
								<div class="input glht">
									<!-- <label>管理后台</label> -->
									<label>后台管理系统</label>
								</div>
							</div>
							<div class="input-box">
								<div class="input username">
									<input type="text" id="orgid" placeholder="企业编号"/>
								</div>
							</div>
							<div class="input-box">
								<div class="input username">
									<input type="text" id="userName" placeholder="用户名"/>
								</div>
							</div>
							<div class="input-box">
								<div class="input psw" id="psw">
									<input type="password" id="password" placeholder="密码"/>
								</div>
							</div>
							<div class="input-box">
								<div id="btn" class="loginButton">
									<input type="button" class="button" value="登录" />
								</div>
							</div>
						</div>
					</div>
				</div>
				<!-- <div class="botton">dddd</div> -->
			</div>

		</div>

	</body>
	<script type="text/javascript">
		var height = $(window).height() > 445 ? $(window).height() : 445;
		$("#container").height(height);
		var bdheight = ($(window).height() - $('#bd').height()) / 2 - 20;
		$('#bd').css('padding-top', bdheight);
		$(window).resize(function(e) {
			var height = $(window).height() > 445 ? $(window).height() : 445;
			$("#container").height(height);
			var bdheight = ($(window).height() - $('#bd').height()) / 2 - 20;
			$('#bd').css('padding-top', bdheight);
		});
		$('select').select();

		$('.loginButton').click(function(e) {
			load();
			postBody("/admin/api/UserController/login", {
				login_name: $("#userName").val(),
				password: $("#password").val(),
				orgid:$("#orgid").val()
			}, function(res) {
				layer.closeAll();
				if (res.code == 0) {
					layer.alert(res.msg);
				} else {
					let token = res.data.token;
					localStorage.setItem("token", token);
					localStorage.setItem("user", JSON.stringify(res.data));
					localStorage.setItem("login_html",window.location.href);
					let main_url = res.data.main_url;
					if(null!=main_url && ""!=main_url && undefined!=main_url){
						document.location.href = main_url;
					}else {
						document.location.href = "main.html";
					}
				}
			})

		});
	</script>

</html>
